package cn.skyquant.quant4j.service.boot.model.goods;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsTickRepository extends CrudRepository<GoodsTick, Integer> {
    Sort thedate_sort = new Sort(Sort.Direction.DESC,"thedate");

    @Query("select u from GoodsTick u where u.goods.id = ?1")
    List<GoodsTick> findByGoodsId(Integer goodsId, Sort sort);
}
